package com.design.strategy.supermarket;

/**
 * Created by yijy on 2018/1/16.
 */
public class DiscountPriceStrategy implements PricesStrategyInterface {

    private float mPrice;
    private float mDiscountRate; // 折扣率（0F ~ 1F）

    public DiscountPriceStrategy(float mPrice,float mDiscountRate) {
        this.mPrice = mPrice;
        this.mDiscountRate = mDiscountRate;
    }

    @Override
    public float resultPrices() {
        return mPrice*mDiscountRate;
    }
}
